package com.by.controller;

import com.by.bean.ForwardInquiry;
import com.by.bean.PageBean;
import com.by.bean.ResultBean;
import com.by.query.ForwardInquiryQuery;
import com.by.service.ForwardInquiryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * date 2025/2/27 10:41
 * author bjj
 * decoration
 * version 1.0
 * since jdk11
 */
@RestController
@Api(tags = "货代询价")
@RequestMapping("/api")
public class ForwardInquiryController extends BaseController{
    @Autowired
    ForwardInquiryService forwardInquiryService;

    @ApiOperation("根据条件分页查询")
    @PostMapping("/forwardInquiry/queryList")
    public ResultBean queryList(@RequestBody ForwardInquiryQuery query){
        PageBean pageBean = forwardInquiryService.queryList(query);
        return success("查询成功",pageBean);
    }
    @ApiOperation("更新")
    @PostMapping("/forwardInquiry/update")
    public ResultBean update(@RequestBody ForwardInquiry forwardInquiry){
        int rs = forwardInquiryService.update(forwardInquiry);
        return updateResult(rs);
    }
}
